The SimpleMenu Component > FSimpleMenu.setClickHandler()

 

FSimpleMenu.setClickHandler()

Availability

Flash Player 6.

Usage

sm_instance.setClickHandler(handler, obj)

Parameters

handler - The string name of the event handler.
obj - The object that contains the handler, _parent if omitted.

Returns

Nothing.

Description

Sets the Click Handler for when an item on the SimpleMenu is clicked. The Click Handler will be passed a reference to the SimpleMenu as well as the index of the item that is clicked.

Example

The following code sets the Click Handler to the myClickHandler in the _root:

_root.myClickHandler = function(component, index) {
    trace("Item #" + index + "of " + component + "was clicked");
}

See also

FSimpleMenu.getClickHandler